home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-9.10-netbook-remix-PL.iso / casper / filesystem.squashfs / usr / share / mc / edit.indent.rc < prev    next >
Text File  |  2009-10-25  |  788b  |  32 lines

  1. #! /bin/sh
  2. # *** External Formatter (Indenter) for GNU Midnight Commander.
  3. # arguments:
  4. #    $1 - Name of the file being edited
  5. #    $2 - Name of the file to be processed
  6.  
  7. exec >/dev/null
  8.  
  9. case `echo $1 |sed 's/^.*\.//'` in
  10.     c|h)
  11.     # ftp://ftp.gnu.org/pub/gnu/indent/
  12.     # Please add options to your ~/.indent.pro, not here.
  13.         indent "$2"
  14.     ;;
  15.     C|cc|CC|cxx|CXX|cpp|CPP)
  16.     # http://astyle.sourceforge.net/
  17.         astyle "$2"
  18.     ;;
  19.     java|JAVA)
  20.     # http://astyle.sourceforge.net/
  21.         astyle --style=java --mode=java "$2"
  22.     ;;
  23.     htm|html|HTM|HTML)
  24.     # http://tidy.sourceforge.net/
  25.         tidy -q -m -ascii -wrap 80 "$2"
  26.     ;;
  27.     *)
  28.     # http://www.gnu.org/software/coreutils/
  29.         fmt "$2" >"$2.tmp" && rm -f "$2" && mv -f "$2.tmp" "$2"
  30.     ;;
  31. esac
  32.